// 公共设置key
let commonSettingKey = [
    { key: 'debugModel', type: "开关" },
    { key: 'debugSleep', type: "输入框" },
    { key: 'webSocketLog', type: "开关" },
    { key: '自动运行', type: "开关" },
    { key: 'canvasOffset', type: "输入框" },
    { key: '连续同一页面次数', type: "下拉框" },
    { key: '连续无匹配页面次数', type: "下拉框" },
    { key: "select业务", type: "下拉框" }
]

// 公共设置值域
let commonSettingRange = {
    "select业务": ["固定刷屏"], // 业务名称值域列表
    "连续同一页面次数": [15, 20, 25, 30, 35, 40],
    "连续无匹配页面次数": [15, 20, 25, 30, 35, 40]
}


// 坐标偏移系数
let positionOffset = {
    "1080_2400": {// 标准分辨率不偏移
        "offsetX": 0,
        "offsetY": 0
    }
}

// 第一套匹配页面 命名规则 pageSetting_ + 业务名称
let pageSetting_固定刷屏 = {
    "关注": {
        "1080_2400": {
            "relation": {
                "total": "or",
                "analysisChart": "or",
                "multipleColor": "or",
                "multipleImg": "or"
            },
            "analysisChart": [],
            "multipleColor": [],
            "multipleImg": [{
                "threshold": "90",
                "maxVal": 255,
                "imgThreshold": 0.7,
                "colorThreshold": 26,
                "bigScale": 1,
                "smallScale": 1,
                "pathName": "./res/1080_2400/指定页面_关注图标.png",
                "context": "关注",
                "isOpenGray": 0,
                "isOpenThreshold": 0,
                "openSplit": true,
                "position": [9, 239, "1072", "341"],
                "featuresThreshold": 0.7,
                "color": "#F4F5F7",
                "colorOther": []
            }]
        }
    },
    "推荐": {
        "1080_2400": {
            "relation": {
                "total": "or",
                "analysisChart": "or",
                "multipleColor": "or",
                "multipleImg": "or"
            },
            "analysisChart": [],
            "multipleColor": [],
            "multipleImg": [{
                "threshold": "90",
                "maxVal": 255,
                "imgThreshold": 0.7,
                "colorThreshold": 26,
                "bigScale": 1,
                "smallScale": 1,
                "pathName": "./res/1080_2400/指定页面_推荐图标.png",
                "context": "关注",
                "isOpenGray": 0,
                "isOpenThreshold": 0,
                "openSplit": true,
                "position": [9, 239, "1072", "341"],
                "featuresThreshold": 0.7,
                "color": "#F4F5F7",
                "colorOther": []
            }]
        }
    },
    "热榜": {
        "1080_2400": {
            "relation": {
                "total": "or",
                "analysisChart": "or",
                "multipleColor": "or",
                "multipleImg": "or"
            },
            "analysisChart": [],
            "multipleColor": [],
            "multipleImg": [{
                "threshold": "90",
                "maxVal": 255,
                "imgThreshold": 0.7,
                "colorThreshold": 26,
                "bigScale": 1,
                "smallScale": 1,
                "pathName": "./res/1080_2400/指定页面_图标.png",
                "context": "关注",
                "isOpenGray": 0,
                "isOpenThreshold": 0,
                "openSplit": true,
                "position": [9, 239, "1072", "341"],
                "featuresThreshold": 0.7,
                "color": "#F4F5F7",
                "colorOther": []
            }]
        }
    },
    "首页": {
        "1080_2400": {
            "relation": {
                "total": "or",
                "analysisChart": "or",
                "multipleColor": "or",
                "multipleImg": "or"
            },
            "analysisChart": [{
                "threshold": 60,
                "maxVal": 255,
                "imgThreshold": 0.7,
                "colorThreshold": 26,
                "bigScale": 1,
                "smallScale": 1,
                "pathName": "",
                "context": "首页",
                "isOpenGray": 0,
                "isOpenThreshold": 0,
                "openSplit": true,
                "position": [5, 2271, "352", "2395"],
                "featuresThreshold": 0.7,
                "color": "#F4F5F7",
                "colorOther": [
                    [-11, 0, "#F4F5F7"],
                    [189, 39, "#F4F5F7"],
                    [197, 47, "#F4F5F7"]
                ],
                "matchingType": "contains"
            }],
            "multipleColor": [],
            "multipleImg": [{
                "threshold": 60,
                "maxVal": 255,
                "imgThreshold": "0.7",
                "colorThreshold": 26,
                "bigScale": 1,
                "smallScale": 1,
                "pathName": "./res/1080_2400/首页_首页图标.png",
                "context": "",
                "isOpenGray": 0,
                "isOpenThreshold": 0,
                "openSplit": true,
                "position": [5, 2271, "352", "2395"],
                "featuresThreshold": 0.7,
                "color": "#F4F5F7",
                "colorOther": [
                    [-11, 0, "#F4F5F7"],
                    [189, 39, "#F4F5F7"],
                    [197, 47, "#F4F5F7"]
                ],
                "canvasMsg": "111"
            }]
        }
    }
}

// 第二套匹配页面
let pageSetting_竞技场 = {
    "竞技场": {
        "1080_2400": {
            'relation': { "total": "or", "analysisChart": "or", "multipleColor": "or", "multipleImg": "or", "nextKey": "选择队伍_待开始" },
            'analysisChart': [{ "position": [1101, 376, 1283, 422], "threshold": 60, "maxVal": 255, "context": "锁定", "matchingType": "contains", "isOpenGray": 1, "isOpenThreshold": 1, "canvasMsg": "锁定" }],
            'multipleColor': [],
            'multipleImg': [{ "position": [1101, 376, 1283, 422], "threshold": 60, "maxVal": 255, "pathName": "./res/锁定队伍_锁定队伍.png", "imgThreshold": 0.8, "isOpenGray": 1, "isOpenThreshold": 1, "canvasMsg": "锁定队伍_锁定队伍" }]
        }
    }
}

// 业务操作参数
let serviceOperateParam = {
	"关注": {},
	"推荐": {},
	"热榜": {},
	"首页": {
		"指定页面_识字点击": {
			"1080_2400": {
				"threshold": 60,
				"maxVal": 255,
				"imgThreshold": 0.7,
				"colorThreshold": 26,
				"bigScale": 1,
				"smallScale": 1,
				"pathName": "",
				"context": "关注",
				"isOpenGray": 0,
				"isOpenThreshold": 0,
				"openSplit": true,
				"position": [17, 223, "1061", "347"],
				"featuresThreshold": 0.7,
				"color": "#F4F5F7",
				"colorOther": [
					[-11, 0, "#F4F5F7"],
					[189, 39, "#F4F5F7"],
					[197, 47, "#F4F5F7"],
					[906, -2001, "#FFFFFF"]
				]
			}
		}
	}
}

// 默认逻辑关系
const relationDeafult = { "total": "or", "analysisChart": "or", "multipleColor": "or", "multipleImg": "or" }


let constant = {
    'commonSettingKey': commonSettingKey,
    'commonSettingRange': commonSettingRange,
    'positionOffset': positionOffset,
    'serviceOperateParam': serviceOperateParam,
    'relationDeafult': relationDeafult
}
let select业务 = commonSettingRange.select业务
select业务.forEach((item) => {
    let key = 'pageSetting_' + item;
    constant[key] = this[key]
})
module.exports = constant